cmake_minimum_required(VERSION 3.0.2)
project(hello)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_BUILD_TYPE Debug) # you can choose Debug or Release
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -O3")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -O3")

# 寻找源文件
file(GLOB_RECURSE PROJECT_SOURCE
	main.cpp)
message(STATUS "src file is: ${PROJECT_SOURCE}")


find_package(catkin REQUIRED COMPONENTS
  roscpp
  rospy
  std_msgs
)
catkin_package()
include_directories(
  ${catkin_INCLUDE_DIRS}
)

# 这句话必须要放在catkin_package()后面
add_executable(${PROJECT_NAME} ${PROJECT_SOURCE})

target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES})

# 包含自定义头文件
include_directories(${PROJECT_SOURCE_DIR}/include)

# # glog
# find_package(glog REQUIRED)
# target_link_libraries(${PROJECT_NAME} glog::glog)
# include_directories(${GLOG_INCLUDE_DIRS})

# # eigen3
# find_package(Eigen3 REQUIRED)
# include_directories(${EIGEN3_INCLUDE_DIRS})

# # ceres
# find_package(Ceres REQUIRED)
# target_link_libraries(${PROJECT_NAME} ${CERES_LIBRARIES})

# # G2O 存疑，我没有安装这个库
# # find_package(G2O REQUIRED)
# # target_link_libraries(${PROJECT_NAME} ${G2O_LIBS})
# # include_directories(${G2O_INCLUDE_DIRS})

# # fmt and Sophus 如果我没有记错的话，这两个库似乎要要一起使用
# find_package(fmt REQUIRED)
# target_link_libraries(${PROJECT_NAME} ${FMT_LIBRARIES}) # ${FMT_LIBRARIES} 似乎也可以直接使用 fmt 代替
# find_package(Sophus REQUIRED)
# target_link_libraries(${PROJECT_NAME} Sophus::Sophus)
# include_directories(${Sophus_INCLUDE_DIRS})

# # yaml
# find_package(yaml-cpp REQUIRED)
# target_link_libraries(${PROJECT_NAME} ${YAML_CPP_LIBRARIES})

# # abseil
# find_package(absl REQUIRED)
# target_link_libraries(${PROJECT_NAME} absl::strings absl::str_format absl::time)

# # opencv 4 or 3
# find_package(OpenCV 4 REQUIRED)
# # find_package(OpenCV 3 REQUIRED)
# target_link_libraries(${PROJECT_NAME} ${OpenCV_LIBS})

# # pcl
# find_package(PCL 1.2 REQUIRED)
# link_directories(${PCL_LIBRARY_DIRS})
# add_definitions(${PCL_DEFINITIONS})
# target_link_libraries(${PROJECT_NAME} ${PCL_LIBRARIES})
# include_directories(${PCL_INCLUDE_DIRS})
